package tree;

import java.util.ArrayList;
import java.util.List;

/** 
 * 节点类 
 * @author bearsmall 
 * 
 */  
public class TreeNode {  
    private String id;//主键ID
    private String name;//节点内容
    private String pid;//父节点ID
    
    private String title;
    
    public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	private List<TreeNode> children = new ArrayList<TreeNode>();//子孙节点  
      
    /*public TreeNode(String id, String name)
    {  
        this.id = id;  
        this.name = name;  
    }
    
    public TreeNode(String id, String name, String pid)
    {
        this.id = id;  
        this.name = name;  
        this.pid = pid;  
    }  */
    
    public String getId() {  
        return id;  
    }
    
    public void setId(String id) {  
        this.id = id;  
    }  
    public String getName() {  
        return name;  
    }
    
    public void setName(String name) {  
        this.name = name;  
    } 
    public String getPid() {  
        return pid;  
    }
    
    public void setPid(String pid) {  
        this.pid = pid;  
    }  
    
    public List<TreeNode> getChildren() {  
        return children;  
    }  
    public void setChildren(List<TreeNode> children) {  
        this.children = children;  
    }
    
    @Override  
    public String toString() {  
        return "TreeNode [id=" + id + ", pid=" + pid + ", content=" + name  
                + ", children=" + children + "]";  
    }  
}